<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Least-squares function approximation</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Least-squares_function_approximation"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.math.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Least-squares_function_approximation rootpage-Least-squares_function_approximation skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Least-squares function approximation</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<p>In <a href="Mathematics" title="Mathematics">mathematics</a>, <b>least squares function approximation</b> applies the principle of <a href="Least_squares" title="Least squares">least squares</a> to <a href="Function_approximation" title="Function approximation">function approximation</a>, by means of a weighted sum of other functions. The best approximation can be defined as that which minimizes the difference between the original function and the approximation; for a least-squares approach the quality of the approximation is measured in terms of the squared differences between the two.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Functional_analysis">Functional analysis</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1236090951">
/* start https://en.wikipedia.org/ */
.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}
/* end https://en.wikipedia.org/ */
</style><div role="note" class="hatnote navigation-not-searchable">See also: <a href="Fourier_series" title="Fourier series">Fourier series</a> and <a href="Generalized_Fourier_series" title="Generalized Fourier series">Generalized Fourier series</a></div>
<p>A generalization to approximation of a data set is the approximation of a function by a sum of other functions, usually an <a href="Orthogonal_functions" title="Orthogonal functions">orthogonal set</a>:<sup id="cite_ref-Lanczos_1-0" class="reference"><a href="#cite_note-Lanczos-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f(x)\approx f_{n}(x)=a_{1}\phi _{1}(x)+a_{2}\phi _{2}(x)+\cdots +a_{n}\phi _{n}(x),\ }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>f</mi>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>≈<!-- ≈ --></mo>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
<msub>
<mi>ϕ<!-- ϕ --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>+</mo>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
<msub>
<mi>ϕ<!-- ϕ --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>+</mo>
<mo>⋯<!-- ⋯ --></mo>
<mo>+</mo>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<msub>
<mi>ϕ<!-- ϕ --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>,</mo>
<mtext> </mtext>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle f(x)\approx f_{n}(x)=a_{1}\phi _{1}(x)+a_{2}\phi _{2}(x)+\cdots +a_{n}\phi _{n}(x),\ }</annotation>
</semantics>
</math></span><img src="./2730998b2ab2ab75c4290b858ae375d2c0f5a98f.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:52.887ex; height:2.843ex;" alt="{\displaystyle f(x)\approx f_{n}(x)=a_{1}\phi _{1}(x)+a_{2}\phi _{2}(x)+\cdots +a_{n}\phi _{n}(x),\ }" loading="lazy"></span></dd></dl>
<p>with the set of functions {<span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \ \phi _{j}(x)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mtext> </mtext>
<msub>
<mi>ϕ<!-- ϕ --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \ \phi _{j}(x)}</annotation>
</semantics>
</math></span><img src="./f3628d9493dcc804fc40f41bc94a1711c38bfa97.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:6.015ex; height:3.009ex;" alt="{\displaystyle \ \phi _{j}(x)}" loading="lazy"></span>} an <a href="Orthonormal_set" class="mw-redirect" title="Orthonormal set">orthonormal set</a> over the interval of interest, <span class="nowrap">say [a, b]</span>: see also <a href="Fej%C3%A9r's_theorem" title="Fejér's theorem">Fejér's theorem</a>. The coefficients {<span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \ a_{j}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mtext> </mtext>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \ a_{j}}</annotation>
</semantics>
</math></span><img src="./41349b34551d674414c7d0c1aca88efdd926ce53.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:2.72ex; height:2.343ex;" alt="{\displaystyle \ a_{j}}" loading="lazy"></span>} are selected to make the magnitude of the difference ||<span class="nowrap"><i>f</i> − <i>f</i><sub><i>n</i></sub></span>||<sup>2</sup> as small as possible. For example, the magnitude, or norm, of a function <span class="nowrap"><i>g</i> (<i>x</i> )</span> over the <span class="nowrap">interval [a, b]</span> can be defined by:<sup id="cite_ref-Folland_2-0" class="reference"><a href="#cite_note-Folland-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \|g\|=\left(\int _{a}^{b}g^{*}(x)g(x)\,dx\right)^{1/2}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo fence="false" stretchy="false">‖<!-- ‖ --></mo>
<mi>g</mi>
<mo fence="false" stretchy="false">‖<!-- ‖ --></mo>
<mo>=</mo>
<msup>
<mrow>
<mo>(</mo>
<mrow>
<msubsup>
<mo>∫<!-- ∫ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>a</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>b</mi>
</mrow>
</msubsup>
<msup>
<mi>g</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo>∗<!-- ∗ --></mo>
</mrow>
</msup>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mi>g</mi>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mspace width="thinmathspace"></mspace>
<mi>d</mi>
<mi>x</mi>
</mrow>
<mo>)</mo>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<mn>2</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \|g\|=\left(\int _{a}^{b}g^{*}(x)g(x)\,dx\right)^{1/2}}</annotation>
</semantics>
</math></span><img src="./e2ba10510391613f33f39f05a46746ad4f074e05.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:28.947ex; height:7.009ex;" alt="{\displaystyle \|g\|=\left(\int _{a}^{b}g^{*}(x)g(x)\,dx\right)^{1/2}}" loading="lazy"></span></dd></dl>
<p>where the ‘*’ denotes <a href="Complex_conjugate" title="Complex conjugate">complex conjugate</a> in the case of complex functions. The extension of Pythagoras' theorem in this manner leads to <a href="Function_space" title="Function space">function spaces</a> and the notion of <a href="Lebesgue_measure" title="Lebesgue measure">Lebesgue measure</a>, an idea of “space” more general than the original basis of Euclidean geometry. The <span class="nowrap">{ <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \phi _{j}(x)\ }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>ϕ<!-- ϕ --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mtext> </mtext>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \phi _{j}(x)\ }</annotation>
</semantics>
</math></span><img src="./5a9210925644f147769211a89f5577897dde3f20.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:6.015ex; height:3.009ex;" alt="{\displaystyle \phi _{j}(x)\ }" loading="lazy"></span> } </span> satisfy <a href="Orthogonal" class="mw-redirect" title="Orthogonal">orthonormality relations</a>:<sup id="cite_ref-Folland2_3-0" class="reference"><a href="#cite_note-Folland2-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \int _{a}^{b}\phi _{i}^{*}(x)\phi _{j}(x)\,dx=\delta _{ij},}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msubsup>
<mo>∫<!-- ∫ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>a</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>b</mi>
</mrow>
</msubsup>
<msubsup>
<mi>ϕ<!-- ϕ --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>∗<!-- ∗ --></mo>
</mrow>
</msubsup>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<msub>
<mi>ϕ<!-- ϕ --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mspace width="thinmathspace"></mspace>
<mi>d</mi>
<mi>x</mi>
<mo>=</mo>
<msub>
<mi>δ<!-- δ --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
<mi>j</mi>
</mrow>
</msub>
<mo>,</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \int _{a}^{b}\phi _{i}^{*}(x)\phi _{j}(x)\,dx=\delta _{ij},}</annotation>
</semantics>
</math></span><img src="./1701b20e55f1d0d0efec947942e024bd7995d58e.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.338ex; width:23.989ex; height:6.343ex;" alt="{\displaystyle \int _{a}^{b}\phi _{i}^{*}(x)\phi _{j}(x)\,dx=\delta _{ij},}" loading="lazy"></span></dd></dl>
<p>where <i>δ</i><sub><i>ij</i></sub> is the <a href="Kronecker_delta" title="Kronecker delta">Kronecker delta</a>. Substituting function <span class="nowrap"><i>f</i><sub><i>n</i></sub></span> into these equations then leads to
the <i>n</i>-dimensional <a href="Pythagorean_theorem" title="Pythagorean theorem">Pythagorean theorem</a>:<sup id="cite_ref-Wood_4-0" class="reference"><a href="#cite_note-Wood-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \|f_{n}\|^{2}=|a_{1}|^{2}+|a_{2}|^{2}+\cdots +|a_{n}|^{2}.\,}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo fence="false" stretchy="false">‖<!-- ‖ --></mo>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<msup>
<mo fence="false" stretchy="false">‖<!-- ‖ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
<msup>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>+</mo>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
<msup>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>+</mo>
<mo>⋯<!-- ⋯ --></mo>
<mo>+</mo>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<msup>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>.</mo>
<mspace width="thinmathspace"></mspace>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \|f_{n}\|^{2}=|a_{1}|^{2}+|a_{2}|^{2}+\cdots +|a_{n}|^{2}.\,}</annotation>
</semantics>
</math></span><img src="./3ebfa6e0f7374a47f4c64c3a6b6dd0c17b34e3d7.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:35.174ex; height:3.343ex;" alt="{\displaystyle \|f_{n}\|^{2}=|a_{1}|^{2}+|a_{2}|^{2}+\cdots +|a_{n}|^{2}.\,}" loading="lazy"></span></dd></dl>
<p>The coefficients {<i>a</i><sub><i>j</i></sub>} making <span class="nowrap">||<i>f</i> − <i>f</i><sub><i>n</i></sub>||<sup>2</sup></span> as small as possible are found to be:<sup id="cite_ref-Lanczos_1-1" class="reference"><a href="#cite_note-Lanczos-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle a_{j}=\int _{a}^{b}\phi _{j}^{*}(x)f(x)\,dx.}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo>=</mo>
<msubsup>
<mo>∫<!-- ∫ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>a</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>b</mi>
</mrow>
</msubsup>
<msubsup>
<mi>ϕ<!-- ϕ --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>∗<!-- ∗ --></mo>
</mrow>
</msubsup>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mi>f</mi>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mspace width="thinmathspace"></mspace>
<mi>d</mi>
<mi>x</mi>
<mo>.</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle a_{j}=\int _{a}^{b}\phi _{j}^{*}(x)f(x)\,dx.}</annotation>
</semantics>
</math></span><img src="./3c5a26ff78be391fee847ef498591c9cb2f59445.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.338ex; width:22.603ex; height:6.343ex;" alt="{\displaystyle a_{j}=\int _{a}^{b}\phi _{j}^{*}(x)f(x)\,dx.}" loading="lazy"></span></dd></dl>
<p>The generalization of the <i>n</i>-dimensional Pythagorean theorem to <i>infinite-dimensional </i> <a href="Real_number" title="Real number">real</a> inner product spaces is known as <a href="Parseval's_identity" title="Parseval's identity">Parseval's identity</a> or Parseval's equation.<sup id="cite_ref-Folland3_5-0" class="reference"><a href="#cite_note-Folland3-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup> Particular examples of such a representation of a function are the <a href="Fourier_series" title="Fourier series">Fourier series</a> and the <a href="Generalized_Fourier_series" title="Generalized Fourier series">generalized Fourier series</a>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Further_discussion">Further discussion</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Using_linear_algebra">Using linear algebra</h3></div>
<p>It follows that one can find a "best" approximation of another function by minimizing the area between two functions, a continuous function <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>f</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle f}</annotation>
</semantics>
</math></span><img src="./132e57acb643253e7810ee9702d9581f159a1c61.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.279ex; height:2.509ex;" alt="{\displaystyle f}" loading="lazy"></span> on <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle [a,b]}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">[</mo>
<mi>a</mi>
<mo>,</mo>
<mi>b</mi>
<mo stretchy="false">]</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle [a,b]}</annotation>
</semantics>
</math></span><img src="./9c4b788fc5c637e26ee98b45f89a5c08c85f7935.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.555ex; height:2.843ex;" alt="{\displaystyle [a,b]}" loading="lazy"></span> and a function <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle g\in W}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>g</mi>
<mo>∈<!-- ∈ --></mo>
<mi>W</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle g\in W}</annotation>
</semantics>
</math></span><img src="./64ffd704ef419b6b79cb07de8e5f579da4baa530.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:6.392ex; height:2.509ex;" alt="{\displaystyle g\in W}" loading="lazy"></span> where <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle W}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>W</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle W}</annotation>
</semantics>
</math></span><img src="./54a9c4c547f4d6111f81946cad242b18298d70b7.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.435ex; height:2.176ex;" alt="{\displaystyle W}" loading="lazy"></span> is a subspace of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle C[a,b]}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>C</mi>
<mo stretchy="false">[</mo>
<mi>a</mi>
<mo>,</mo>
<mi>b</mi>
<mo stretchy="false">]</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle C[a,b]}</annotation>
</semantics>
</math></span><img src="./7c1625217aad8c105c50c975599e45192b2bfbec.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.321ex; height:2.843ex;" alt="{\displaystyle C[a,b]}" loading="lazy"></span>:
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\text{Area}}=\int _{a}^{b}\left\vert f(x)-g(x)\right\vert \,dx,}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mtext>Area</mtext>
</mrow>
<mo>=</mo>
<msubsup>
<mo>∫<!-- ∫ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>a</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>b</mi>
</mrow>
</msubsup>
<mrow>
<mo>|</mo>
<mrow>
<mi>f</mi>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>−<!-- − --></mo>
<mi>g</mi>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
</mrow>
<mo>|</mo>
</mrow>
<mspace width="thinmathspace"></mspace>
<mi>d</mi>
<mi>x</mi>
<mo>,</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\text{Area}}=\int _{a}^{b}\left\vert f(x)-g(x)\right\vert \,dx,}</annotation>
</semantics>
</math></span><img src="./23ad7c775152df9adcb00762213c7ceefee03e75.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.338ex; width:28.51ex; height:6.343ex;" alt="{\displaystyle {\text{Area}}=\int _{a}^{b}\left\vert f(x)-g(x)\right\vert \,dx,}" loading="lazy"></span></dd></dl>
<p>all within the subspace <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle W}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>W</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle W}</annotation>
</semantics>
</math></span><img src="./54a9c4c547f4d6111f81946cad242b18298d70b7.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.435ex; height:2.176ex;" alt="{\displaystyle W}" loading="lazy"></span>. Due to the frequent difficulty of evaluating integrands involving absolute value, one can instead define
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \int _{a}^{b}[f(x)-g(x)]^{2}\,dx}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msubsup>
<mo>∫<!-- ∫ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>a</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>b</mi>
</mrow>
</msubsup>
<mo stretchy="false">[</mo>
<mi>f</mi>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>−<!-- − --></mo>
<mi>g</mi>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<msup>
<mo stretchy="false">]</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mspace width="thinmathspace"></mspace>
<mi>d</mi>
<mi>x</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \int _{a}^{b}[f(x)-g(x)]^{2}\,dx}</annotation>
</semantics>
</math></span><img src="./0c1b945f1142ff48dc9110b80d95539993579c74.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.338ex; width:20.195ex; height:6.343ex;" alt="{\displaystyle \int _{a}^{b}[f(x)-g(x)]^{2}\,dx}" loading="lazy"></span></dd></dl>
<p>as an adequate criterion for obtaining the least squares approximation, function <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle g}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>g</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle g}</annotation>
</semantics>
</math></span><img src="./d3556280e66fe2c0d0140df20935a6f057381d77.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.116ex; height:2.009ex;" alt="{\displaystyle g}" loading="lazy"></span>, of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>f</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle f}</annotation>
</semantics>
</math></span><img src="./132e57acb643253e7810ee9702d9581f159a1c61.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.279ex; height:2.509ex;" alt="{\displaystyle f}" loading="lazy"></span> with respect to the inner product space <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle W}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>W</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle W}</annotation>
</semantics>
</math></span><img src="./54a9c4c547f4d6111f81946cad242b18298d70b7.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.435ex; height:2.176ex;" alt="{\displaystyle W}" loading="lazy"></span>.
</p><p>As such, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \lVert f-g\rVert ^{2}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo fence="false" stretchy="false">‖<!-- ‖ --></mo>
<mi>f</mi>
<mo>−<!-- − --></mo>
<mi>g</mi>
<msup>
<mo fence="false" stretchy="false">‖<!-- ‖ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \lVert f-g\rVert ^{2}}</annotation>
</semantics>
</math></span><img src="./fbba44eaed83850f648f6dc246a5035542b8c1c1.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:8.614ex; height:3.176ex;" alt="{\displaystyle \lVert f-g\rVert ^{2}}" loading="lazy"></span> or, equivalently, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \lVert f-g\rVert }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo fence="false" stretchy="false">‖<!-- ‖ --></mo>
<mi>f</mi>
<mo>−<!-- − --></mo>
<mi>g</mi>
<mo fence="false" stretchy="false">‖<!-- ‖ --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \lVert f-g\rVert }</annotation>
</semantics>
</math></span><img src="./d7524e3b8fe4918538a81912386d9b1a6c4d42eb.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:7.56ex; height:2.843ex;" alt="{\displaystyle \lVert f-g\rVert }" loading="lazy"></span>, can thus be written in vector form:
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \int _{a}^{b}[f(x)-g(x)]^{2}\,dx=\left\langle f-g,f-g\right\rangle =\lVert f-g\rVert ^{2}.}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msubsup>
<mo>∫<!-- ∫ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>a</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>b</mi>
</mrow>
</msubsup>
<mo stretchy="false">[</mo>
<mi>f</mi>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>−<!-- − --></mo>
<mi>g</mi>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<msup>
<mo stretchy="false">]</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mspace width="thinmathspace"></mspace>
<mi>d</mi>
<mi>x</mi>
<mo>=</mo>
<mrow>
<mo>⟨</mo>
<mrow>
<mi>f</mi>
<mo>−<!-- − --></mo>
<mi>g</mi>
<mo>,</mo>
<mi>f</mi>
<mo>−<!-- − --></mo>
<mi>g</mi>
</mrow>
<mo>⟩</mo>
</mrow>
<mo>=</mo>
<mo fence="false" stretchy="false">‖<!-- ‖ --></mo>
<mi>f</mi>
<mo>−<!-- − --></mo>
<mi>g</mi>
<msup>
<mo fence="false" stretchy="false">‖<!-- ‖ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>.</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \int _{a}^{b}[f(x)-g(x)]^{2}\,dx=\left\langle f-g,f-g\right\rangle =\lVert f-g\rVert ^{2}.}</annotation>
</semantics>
</math></span><img src="./29cdda7506886c0e092566a8dd56b2c6004df2bd.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.338ex; width:48.966ex; height:6.343ex;" alt="{\displaystyle \int _{a}^{b}[f(x)-g(x)]^{2}\,dx=\left\langle f-g,f-g\right\rangle =\lVert f-g\rVert ^{2}.}" loading="lazy"></span></dd></dl>
<p>In other words, the least squares approximation of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>f</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle f}</annotation>
</semantics>
</math></span><img src="./132e57acb643253e7810ee9702d9581f159a1c61.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.279ex; height:2.509ex;" alt="{\displaystyle f}" loading="lazy"></span> is the function <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle g\in {\text{ subspace }}W}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>g</mi>
<mo>∈<!-- ∈ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mtext> subspace </mtext>
</mrow>
<mi>W</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle g\in {\text{ subspace }}W}</annotation>
</semantics>
</math></span><img src="./4423b5499eeae726eebec0eedff66895ceb6fde2.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:16.491ex; height:2.509ex;" alt="{\displaystyle g\in {\text{ subspace }}W}" loading="lazy"></span> closest to <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>f</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle f}</annotation>
</semantics>
</math></span><img src="./132e57acb643253e7810ee9702d9581f159a1c61.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.279ex; height:2.509ex;" alt="{\displaystyle f}" loading="lazy"></span> in terms of the inner product <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \left\langle f,g\right\rangle }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow>
<mo>⟨</mo>
<mrow>
<mi>f</mi>
<mo>,</mo>
<mi>g</mi>
</mrow>
<mo>⟩</mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \left\langle f,g\right\rangle }</annotation>
</semantics>
</math></span><img src="./94c7e3388b044fc8e84567bfb1c58ded7170067c.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:5.238ex; height:2.843ex;" alt="{\displaystyle \left\langle f,g\right\rangle }" loading="lazy"></span>. Furthermore, this can be applied with a theorem:
</p>
<dl><dd>Let <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>f</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle f}</annotation>
</semantics>
</math></span><img src="./132e57acb643253e7810ee9702d9581f159a1c61.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.279ex; height:2.509ex;" alt="{\displaystyle f}" loading="lazy"></span> be continuous on <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle [a,b]}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">[</mo>
<mi>a</mi>
<mo>,</mo>
<mi>b</mi>
<mo stretchy="false">]</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle [a,b]}</annotation>
</semantics>
</math></span><img src="./9c4b788fc5c637e26ee98b45f89a5c08c85f7935.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.555ex; height:2.843ex;" alt="{\displaystyle [a,b]}" loading="lazy"></span>, and let <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle W}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>W</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle W}</annotation>
</semantics>
</math></span><img src="./54a9c4c547f4d6111f81946cad242b18298d70b7.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.435ex; height:2.176ex;" alt="{\displaystyle W}" loading="lazy"></span> be a finite-dimensional subspace of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle C[a,b]}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>C</mi>
<mo stretchy="false">[</mo>
<mi>a</mi>
<mo>,</mo>
<mi>b</mi>
<mo stretchy="false">]</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle C[a,b]}</annotation>
</semantics>
</math></span><img src="./7c1625217aad8c105c50c975599e45192b2bfbec.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.321ex; height:2.843ex;" alt="{\displaystyle C[a,b]}" loading="lazy"></span>. The least squares approximating function of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>f</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle f}</annotation>
</semantics>
</math></span><img src="./132e57acb643253e7810ee9702d9581f159a1c61.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.279ex; height:2.509ex;" alt="{\displaystyle f}" loading="lazy"></span> with respect to <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle W}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>W</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle W}</annotation>
</semantics>
</math></span><img src="./54a9c4c547f4d6111f81946cad242b18298d70b7.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.435ex; height:2.176ex;" alt="{\displaystyle W}" loading="lazy"></span> is given by
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle g=\left\langle f,{\vec {w}}_{1}\right\rangle {\vec {w}}_{1}+\left\langle f,{\vec {w}}_{2}\right\rangle {\vec {w}}_{2}+\cdots +\left\langle f,{\vec {w}}_{n}\right\rangle {\vec {w}}_{n},}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>g</mi>
<mo>=</mo>
<mrow>
<mo>⟨</mo>
<mrow>
<mi>f</mi>
<mo>,</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>w</mi>
<mo stretchy="false">→<!-- → --></mo>
</mover>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
</mrow>
<mo>⟩</mo>
</mrow>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>w</mi>
<mo stretchy="false">→<!-- → --></mo>
</mover>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
<mo>+</mo>
<mrow>
<mo>⟨</mo>
<mrow>
<mi>f</mi>
<mo>,</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>w</mi>
<mo stretchy="false">→<!-- → --></mo>
</mover>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
</mrow>
<mo>⟩</mo>
</mrow>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>w</mi>
<mo stretchy="false">→<!-- → --></mo>
</mover>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
<mo>+</mo>
<mo>⋯<!-- ⋯ --></mo>
<mo>+</mo>
<mrow>
<mo>⟨</mo>
<mrow>
<mi>f</mi>
<mo>,</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>w</mi>
<mo stretchy="false">→<!-- → --></mo>
</mover>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
</mrow>
<mo>⟩</mo>
</mrow>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>w</mi>
<mo stretchy="false">→<!-- → --></mo>
</mover>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo>,</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle g=\left\langle f,{\vec {w}}_{1}\right\rangle {\vec {w}}_{1}+\left\langle f,{\vec {w}}_{2}\right\rangle {\vec {w}}_{2}+\cdots +\left\langle f,{\vec {w}}_{n}\right\rangle {\vec {w}}_{n},}</annotation>
</semantics>
</math></span><img src="./4f90ed9ad989542f895ccf84d0a9a86417e4b808.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:46.271ex; height:2.843ex;" alt="{\displaystyle g=\left\langle f,{\vec {w}}_{1}\right\rangle {\vec {w}}_{1}+\left\langle f,{\vec {w}}_{2}\right\rangle {\vec {w}}_{2}+\cdots +\left\langle f,{\vec {w}}_{n}\right\rangle {\vec {w}}_{n},}" loading="lazy"></span></dd></dl></dd>
<dd>where <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle B=\{{\vec {w}}_{1},{\vec {w}}_{2},\dots ,{\vec {w}}_{n}\}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>B</mi>
<mo>=</mo>
<mo fence="false" stretchy="false">{</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>w</mi>
<mo stretchy="false">→<!-- → --></mo>
</mover>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
<mo>,</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>w</mi>
<mo stretchy="false">→<!-- → --></mo>
</mover>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
<mo>,</mo>
<mo>…<!-- … --></mo>
<mo>,</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>w</mi>
<mo stretchy="false">→<!-- → --></mo>
</mover>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo fence="false" stretchy="false">}</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle B=\{{\vec {w}}_{1},{\vec {w}}_{2},\dots ,{\vec {w}}_{n}\}}</annotation>
</semantics>
</math></span><img src="./8b1c9b2d97b2f361ec6858fd18e51779e827d18a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:21.719ex; height:2.843ex;" alt="{\displaystyle B=\{{\vec {w}}_{1},{\vec {w}}_{2},\dots ,{\vec {w}}_{n}\}}" loading="lazy"></span> is an orthonormal basis for <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle W}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>W</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle W}</annotation>
</semantics>
</math></span><img src="./54a9c4c547f4d6111f81946cad242b18298d70b7.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.435ex; height:2.176ex;" alt="{\displaystyle W}" loading="lazy"></span>.</dd></dl>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-Lanczos-1"><span class="mw-cite-backlink">^ <a href="#cite_ref-Lanczos_1-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-Lanczos_1-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text">
<style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFCornelius_Lanczos1988" class="citation book cs1">Cornelius Lanczos (1988). <a rel="nofollow" class="external text" href="https://books.google.com/books?id=6E85hExIqHYC&pg=PA212"><i>Applied analysis</i></a> (Reprint of 1956 Prentice–Hall ed.). Dover Publications. pp. <span class="nowrap">212–</span>213. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>0-486-65656-X</bdi>.</cite></span>
</li>
<li id="cite_note-Folland-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-Folland_2-0">^</a></b></span> <span class="reference-text">
<cite id="CITEREFGerald_B_Folland2009" class="citation book cs1">Gerald B Folland (2009). <a rel="nofollow" class="external text" href="https://books.google.com/books?id=ix2iCQ-o9x4C&pg=PA69">"Equation 3.14"</a>. <i>Fourier analysis and its application</i> (Reprint of Wadsworth and Brooks/Cole 1992 ed.). American Mathematical Society Bookstore. p. 69. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-0-8218-4790-9</bdi>.</cite></span>
</li>
<li id="cite_note-Folland2-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-Folland2_3-0">^</a></b></span> <span class="reference-text">
<cite id="CITEREFFolland2009" class="citation book cs1">Folland, Gerald B (2009). <a rel="nofollow" class="external text" href="https://books.google.com/books?id=ix2iCQ-o9x4C&pg=PA69"><i>Fourier Analysis and Its Applications</i></a>. American Mathematical Society. p. 69. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-0-8218-4790-9</bdi>.</cite></span>
</li>
<li id="cite_note-Wood-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-Wood_4-0">^</a></b></span> <span class="reference-text">
<cite id="CITEREFDavid_J._Saville,_Graham_R._Wood1991" class="citation book cs1">David J. Saville, Graham R. Wood (1991). <a rel="nofollow" class="external text" href="https://books.google.com/books?id=8ummgMVRev0C&pg=PA30">"§2.5 Sum of squares"</a>. <i>Statistical methods: the geometric approach</i> (3rd ed.). Springer. p. 30. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>0-387-97517-9</bdi>.</cite></span>
</li>
<li id="cite_note-Folland3-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-Folland3_5-0">^</a></b></span> <span class="reference-text">
<cite id="CITEREFGerald_B_Folland2009" class="citation book cs1">Gerald B Folland (2009-01-13). <a rel="nofollow" class="external text" href="https://books.google.com/books?id=ix2iCQ-o9x4C&pg=PA77">"Equation 3.22"</a>. <i>cited work</i>. American Mathematical Soc. p. 77. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-0-8218-4790-9</bdi>.</cite></span>
</li>
</ol></div></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2023-12-13" href="https://en.wikipedia.org/wiki/?title=Least-squares_function_approximation&oldid=1189632447">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>